package com.yic.module.wms.framework.datapermission.config;

import com.yic.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import com.yic.module.wms.dal.dataobject.erpproducein.ErpProduceInDO;
import com.yic.module.wms.dal.dataobject.itemwarehouse.ItemWarehouseDO;
import com.yic.module.wms.dal.dataobject.itemwarehouseinfo.ItemWarehouseInfoDO;
import com.yic.module.wms.dal.dataobject.producein.ProduceInDO;
import com.yic.module.wms.dal.dataobject.produceout.ProduceOutDO;
import com.yic.module.wms.dal.dataobject.warehouse.WarehouseDO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * WMS 模块的数据权限 Configuration
 *
 * @author 芋道源码
 */
@Configuration(proxyBeanMethods = false)
public class WmsDataPermissionConfiguration {

    @Bean
    public DeptDataPermissionRuleCustomizer wmsDeptDataPermissionRuleCustomizer() {
        return rule -> {
            // 仓库
            rule.addFactoryColumn(WarehouseDO.class);
            // 产品仓储信息
            rule.addFactoryColumn(ItemWarehouseDO.class);
            // 产品库存明细信息
            rule.addFactoryColumn(ItemWarehouseInfoDO.class);
            // 产成品入库
            rule.addFactoryColumn(ProduceInDO.class);
            // 产成品退库
            rule.addFactoryColumn(ProduceOutDO.class);
            // erp生产完工入库
            rule.addFactoryColumn(ErpProduceInDO.class);
        };
    }
}
